home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CHARTP10.ARJ / CHART.H < prev    next >
C/C++ Source or Header  |  1992-01-26  |  1KB  |  48 lines

  1.  
  2. // Copyright 1992, David Perelman-Hall & Jamshid Afshar
  3.  
  4. #ifndef CHART_H
  5. #define CHART_H
  6.  
  7. #include "edge.h"
  8.  
  9. class Agenda;
  10. class RuleList;
  11.  
  12.  
  13. class Chart {
  14. friend ostream& operator << ( ostream& os, const Chart& chart );
  15. private:
  16.    int last_pos;
  17.    Edge_List *active_edges_arr;
  18.    Edge_List *inactive_edges_arr;
  19. public:
  20.    // constructor
  21.    Chart( const Category_Sequence& string );
  22.  
  23.    // coppy constructor
  24.    Chart( const Chart& /*chart*/ )
  25.       { assert(0); }
  26.  
  27.    // assignment operator
  28.    void operator = ( const Chart& /*chart*/ )
  29.       { assert(0); }
  30.  
  31.    // if can combine, then add newly-combined edge to chart
  32.    void add( const Edge& edge, Agenda& agenda, const RuleList& rules );
  33.  
  34.    bool isIn( const Edge& edge ) const
  35.       { if ( edge.isActive() )
  36.          return active_edges_arr[edge.finish()].isMember( edge );
  37.         else
  38.          return inactive_edges_arr[edge.start()].isMember( edge );
  39.       }
  40.  
  41.    bool success( const Category& goal, const Category_Sequence& str ) const;
  42.  
  43.    // destructor
  44.    ~Chart();
  45. };
  46.  
  47. #endif
  48.